package propertydemo.propertydemo;

import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import propertydemo.propertydemo.property.FastBootConfig;
import propertydemo.propertydemo.property.Market;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @Description:
 * @Author: liujinsheng
 * @Date: 2021/7/19.
 */
@RestController
@EnableConfigurationProperties({Market.class})
public class MarketController {
    @Resource
    Market market;
    @Resource
    FastBootConfig fastBootConfig;
    @GetMapping("/get")
    public String Market(){
        List<Market.Curpairs> curpairs= market.getCurpairs();
        System.out.println(curpairs.toString());
        return  market.toString();
    }

    @GetMapping("/fastboot")
    public List fastboot(){
        Map<String ,List<String>> map=fastBootConfig.getRequest();
        List<String> list=    map.get("allow");
        return list;
    }
}
